    	<div class="position">当前位置：<a href="<?php echo Yii::app()->createUrl('member/index/index');?>"><?php echo t('Member','web') ?></a> &gt; <a href="<?php echo Yii::app()->createUrl('member/index/orders');?>">交易管理</a> &gt; 已买到的宝贝</div>
		<!--提示信息 start--> 
        <div class="remind_box mt10"><span class="mem_ico ico_tip"></span>交易提醒：<a class="mr" href="?status=1" title="">待付款（<strong class="c_f60"><?php echo $statusAmount['notpay'];?></strong>）</a><a class="mr" href="?status=3" title="">待确认收货（<strong class="c_f60"><?php echo $statusAmount['notrecieve'];?></strong>）</a><a class="mr" href="?status=4" title="">待评论（<strong class="c_f60"><?php echo $statusAmount['notcomment'];?></strong>）</a></div>
    	<!--提示信息 end--> 
        <!--已买到的宝贝 start-->
         <div class="bought_list mt10">
            <table class="list_table" cellpadding="0" cellspacing="0" width="100%">
                <thead>
                    <tr>
                        <th width="32%" class="bd_l">宝贝</th>
                        <th width="10%">单价</th>
                        <th width="8%">数量</th>
                        <th width="10%">售后</th>
                        <th width="15%">实付款</th>
                        <th width="13%">交易状态</th>
                        <th width="12%" class="bd_r">交易操作</th>                                                       
                    </tr>
                    <tr class="toolbar">
                        <td colspan="7">
                            <div class="pro_filter c_f">
                                <div class="list_page f_r c_666">
									<?php
                                        $this->widget('MiniPager',array(    
                                            'header'=>'',    
                                            'firstPageLabel' => '首页',    
                                            'lastPageLabel' => '尾页',    
                                            'prevPageLabel' => '上一页',    
                                            'nextPageLabel' => '下一页',    
                                            'pages' => $pager,    
                                            'maxButtonCount'=>13    
                                            )    
                                        );    
                                    ?>
                                </div>
                                <div class="filter f_l">
                                	<form method="get" action="">
                                        订单时间
                                        <?php
                                            echo CHtml::dropDownList('time',Yii::app()->request->getParam('time',0),Order::model()->timeList(),array('class'=>'mr10'));
                                        ?>
                                        订单状态
                                        <?php
                                            echo CHtml::dropDownList('status',Yii::app()->request->getParam('status',0),Order::model()->statusList(),array('class'=>'mr10'));
                                        ?>
                                            <input class="t_ipt w_190" value="<?php echo Yii::app()->request->getParam('keywords')?>" type="text" name="keywords" maxlength="50" />
                                            <button class="mem_bgx mem_btn01" type="submit" name="">查找</button>
                                	</form>
                                </div>
                            </div>
                        </td>
                    </tr>
                </thead>
                <?php foreach($data as $order){?>               
                <tbody>
                    <tr class="blank">
                        <td colspan="7"></td>
                    </tr>
                    <tr class="shop">
                        <td colspan="7" class="tl">
                            <span class="ml">订单编号：<?php echo $order['zo_id'];?></span>
                            <span class="ml">
                                <?php if($order['zo_status']==3){?>
                                    成交时间：<?php echo CHtml::encode(date('Y-m-d H:m:s',$order['zo_voer_time'])); ?>
                                <?php }else{ ?>
                                    下单时间：<?php echo CHtml::encode(date('Y-m-d H:m:s', $order['zo_create_time'])); ?>
                                <?php } ?>                                
                            </span>
                            <?php if(F::setting('site_shop_type') == 2){?>
                            <span class="m1">
                            <?php $services = CmpServices::model()->getServiceRand(1);?>
                            <?php  if(!empty($services)){ foreach($services as $val){
                            	if($val->zcs_type==1){
						 	 //QQ账号 
							echo CHtml::link('<span class="ico_qq qq_online2">和我联系</span>','http://wpa.qq.com/msgrd?V=1&amp;Uin='.$val->zcs_account.'&amp;Site='.Yii::app()->name.'&amp;Menu=yes',array('class'=>'c_06c','target'=>'_blank'));
						 }elseif($val->zcs_type==2){
							 //MSN 
							echo CHtml::link($val->zcs_name,'msnim:chat?contact='.$val->zcs_account,array('class'=>'c_06c','target'=>'_blank'));
						 }elseif($val->zcs_type==3){
							 //淘宝旺旺 
							echo CHtml::link($val->zcs_name,'http://amos1.taobao.com/msg.ww?v=2&uid='.$val->zcs_account.'&s=2',array('class'=>'c_06c','target'=>'_blank'));
						 }
                     }} ?>
                     </span>
                     <?php }else if(F::setting('site_shop_type') == 1){?>
                     <span class="ml"><a class="c_06c mr5" href="<?php echo Company::createCompanyUrl($order['company']['zc_sub_domain']);?>" title=""><?php echo $order['company']['zc_name'];?></a>                    
                     </span>
                     <?php }?>
                        </td>
                    </tr>
                    <?php foreach($order['product'] as $key=>$product){?>
                    <tr>
                        <td class="pro tl">
                            <div class="c_img c_img50">
                                <?php echo CHtml::link(Tool::thumb($product['zop_pic'],50,50,$product['zop_title']),array('/home/product/detail','id'=>$product['zp_id']),array('title'=>$product['zop_title'],'target'=>'_blank'))?></div>
                            <p class="title_pro line_18"><a class="c_06c" href="<?php echo Yii::app()->createUrl('home/product/detail',array('id'=>$product['zp_id']));?>" title="" target="_blank"><?php echo $product['zop_title'];?></a></p>
                            <p class="other c_999">
                            <?php foreach($product['zop_spe'] as $name=>$spe){?>
                            	<span class="mr10"><?php echo $spe;?></span>
                            <?php }?>
                            </p>
                        </td>
                        <td class="no_blr"><?php echo $product['zop_real_price'];?></td>
                        <td class="no_blr"><?php echo $product['zop_nums'];?></td>
                        <td class="no_blr">
                        	<?php if($order['zo_pay_status']==2){?>
                                <?php echo CHtml::link('申请退款',array('/member/index/RefundOne','ordproductid'=>$product['zop_id']),array('class'=>'c_06c d_b'))?>
                            <?php }elseif($order['zo_pay_status'] ==5){?>

							<?php }elseif($order['zo_pay_status']!=1){                                 
                                   if($product['zop_status']==2){
                                    echo CHtml::link('退款处理中',array('/member/index/refund'),array('class'=>'c_06c d_b','title'=>'正在处理退款'));
                                   }elseif($product['zop_status']==1){
                                    echo CHtml::link('<span class="c_red">有退款</span>',array('/member/index/refund'),array('class'=>'c_06c d_b','title'=>'已退款'));
                                   }else{
                                    echo CHtml::link('申请退款',array('/member/index/RefundOne','ordproductid'=>$product['zop_id']),array('class'=>'c_06c d_b'));
                                   }
                            }?>
                            <?php
                                if($order['zo_pay_status']!=5 && $order['zo_pay_status']!=1){
                                    $memreport = MemReport::model()->findByAttributes(array('zo_id'=>$order['zo_id']));
                                    
                                    if ($memreport && $memreport->zmr_status == 1) {
                                        # 买家申诉
                                        echo CHtml::link('查看投诉',array('/member/index/ComplainTwo','memreportid'=>$memreport->zmr_id),array('class'=>'c_06c d_b'));
                                    }
                                    elseif ($memreport && $memreport->zmr_status == 3) {
                                        # 商城处理完成
                                        echo CHtml::link('查看投诉',array('/member/index/ComplainThree','memreportid'=>$memreport->zmr_id),array('class'=>'c_06c d_b'));
                                    }
                                    else
                                    {
                                        echo CHtml::link('我要投诉',array('/member/index/ComplainOne','ordproductid'=>$product['zop_id']),array('class'=>'c_06c d_b'));
                                    }
                                }
                            ?>
                        <?php if($key==0){?>
                        </td>
                        <td rowspan="<?php echo $order['productAmount'];?>"><span class="fw_b d_b"><?php echo $order['zo_amount'];?></span><span class="c_999 d_b">（含快递：<?php echo $order['zo_real_freight'];?>）</span></td>
                        <td rowspan="<?php echo $order['productAmount'];?>">
                       		<!--交易状态-->
                        	<?php if($order['zo_status']==2){?>
                            	<span class="d_b c_999" title="">交易关闭</span>
							<?php }elseif($order['zo_status']==3){?>
                            	<span class="d_b c_green3" title="">交易成功</span>
							<?php }elseif($order['zo_status']==1 && $order['zo_pay_status']==1){?>
                            	<span class="d_b c_f60" title="">等待买家付款</span>
                            <?php }elseif($order['zo_status']==1 && $order['zo_pay_status']==5){?>
                                <span class="d_b c_f60" title="">等待买家付款</span>
							<?php }elseif($order['zo_exp_status']==1 && $order['zo_pay_status']==2){?>
                            	<span class="d_b c_f60" title="">等待卖家发货</span>
							<?php }elseif($order['zo_exp_status']==2){?>
                            	<span class="d_b c_f60" title="">卖家已发货</span>
							<?php }?>
                            
                            	<a class="c_06c d_b" href="<?php echo Yii::app()->createUrl('member/index/vieworder',array('orderid'=>$order['zo_id']));?>" title="">订单详情</a>
                            <?php if($order['zo_exp_status']==2){?>
                            	<a class="c_06c d_b" href="/member/index/vieworder/orderid/<?php echo $order['zo_id']; ?>#logistics" title="">查看物流</a>
							<?php }?>
                            
                            <?php if($order['zo_comment']==4){?>
                            	<a class="c_999 d_b" href="javascript:" title="">双方已评</a>
							<?php }?>
                            </td>
                        <td rowspan="<?php echo $order['productAmount'];?>">
                            <?php if($order['zo_pay_status']==1 && $order['zo_status']!=2 ){?>
                                <?php echo CHtml::link('付款',array('/member/order/payorder','orderid'=>$order['zo_id']),array('class'=>'mem_btn mem_btn02 d_b'))?>                            	
                            	<?php echo CHtml::link('取消订单',array('/member/index/cancelorder','orderid'=>$order['zo_id']),array('class'=>'c_06c d_b','onclick'=>'remove()'))?>
							<?php }elseif($order['zo_status']==1 && $order['zo_pay_status']==5){?>
                                线下支付                                                     
                                <?php echo CHtml::link('取消订单',array('/member/index/cancelorder','orderid'=>$order['zo_id']),array('class'=>'c_06c d_b','onclick'=>'remove()'))?>
                            <?php }elseif($order['zo_status']==2){?>
                            	<a class="c_06c d_b" href="<?php echo Yii::app()->createUrl('member/index/deleteorder',array('orderid'=>$order['zo_id']));?>" title="" onclick="del()">删除记录</a>
                            <?php }//elseif($order['zo_exp_status']==1 && $order['zo_pay_status']==2){?>
                            	<!-- <a class="c_06c d_b" href="<?php //echo Yii::app()->createUrl('member/index/remindseller',array('orderid'=>$order['zo_id']));?>" title="">提醒卖家发货</a> -->
							<?php //}?>
                            <?php if($order['zo_exp_status']==2 && $order['zo_pay_status']==2){?>
                            	<?php echo CHtml::link('确认收货',array('/member/order/confirmorder','orderid'=>$order['zo_id']),array('class'=>'mem_btn mem_btn02 d_b'))?> 
                               
							<?php }?>
                            <?php if($order['zo_status']==3 && ($order['zo_comment']==1 || $order['zo_comment']==3)){?>
                                <?php echo CHtml::link('评价',array('/member/index/revieworder/','orderid'=>$order['zo_id']),array('class'=>'mem_btn mem_btn02 d_b'))?>                            	
							<?php }?>
                       </td>
                    	<?php }?>
                    </tr>
					<?php }?>
                </tbody>
                <?php }?>
                <tfoot>
                    <tr class="blank">
                        <td colspan="7"></td>
                    </tr>
                    <tr class="foot">
                        <td colspan="7">
                            <div class="list_page">
								<?php
                                $this->widget('CLinkPager',array(    
                                    'header'=>'',    
                                    'firstPageLabel' => '首页',    
                                    'lastPageLabel' => '尾页',    
                                    'prevPageLabel' => '上一页',    
                                    'nextPageLabel' => '下一页',    
                                    'pages' => $pager,    
                                    'maxButtonCount'=>13    
                                    )    
                                );    
                                ?>
                            </div>
                        </td>
                    </tr>
                </tfoot>
            </table> 
         </div>
    	<!--已买到的宝贝 end-->

<script type="text/javascript">
	//删除记录询问
    function del() {
    if (!confirm("确认要删除吗？")) {
        window.event.returnValue = false;
    }
	}
	//取消订单询问
	function remove(){
	if (!confirm("确认要取消订单吗？")) {
        window.event.returnValue = false;
    }
	}
</script>